import { RouteObject } from 'react-router-dom'
import withLoadable from '@/utils/withLoadable'
const Home = withLoadable(() => import('@/views/Home'))
const Login = withLoadable(() => import('@/views/Login'))
const User = withLoadable(() => import('@/views/user'))
const Comment = withLoadable(() => import("@/views/ServeComment"))
const Goodcomment = withLoadable(() => import("@/views/GoodComment"))
const Admin = withLoadable(() => import('@/views/Admin'))
const Serve = withLoadable(() => import('@/views/Serve'))
const GoodOrder = withLoadable(() => import('@/views/GoodOrder'))
const ServeOrder = withLoadable(() => import('@/views/ServeOrder'))
const Swiper = withLoadable(() => import('@/views/Swiper'))
const Share = withLoadable(() => import("@/views/Share"))
const ServeGoods = withLoadable(() => import('@/views/DWXServergoods'))
const Normalgoods = withLoadable(() => import('@/views/DWXNormalgoods'))
const Serveclass = withLoadable(() => import("@/views/Serveclass"))
const Onvacation = withLoadable(() => import("@/views/Onvacation"))
const Advice = withLoadable(() => import("@/views/Advice"))
const Goodclass = withLoadable(() => import("@/views/Goodclass"))
const Orderhandle = withLoadable(() => import('@/views/orderhandle'))
const OrderProcess = withLoadable(() => import('@/views/orderProcess'))
const OrderHistory = withLoadable(() => import('@/views/orderHistory'))
const WorkerLeave = withLoadable(() => import('@/views/workerLeave'))
const WorkerPost = withLoadable(() => import('@/views/workerPost'))
const ChangeWorkerMsg = withLoadable(() => import('@/views/changeWorkerMsg'))
const Kefu = withLoadable(() => import('@/views/kefu'))
const routes: Array<RouteObject> = [
    {
        path: '/',
        element: <Home />,
        children: [
            {
                path: 'user',
                element: <User />,
            },
            {
                path: 'admin',
                element: <Admin />,
            },
            {
                path: 'serve',
                element: <Serve />,
            },
            {
                path: 'goodOrder',
                element: <GoodOrder />,
            },
            {
                path: 'serveOrder',
                element: <ServeOrder />,
            },
            {
                path: 'swiper',
                element: <Swiper />,
            },
            {
                path: '/comment',
                element: <Comment></Comment>
            },
            {
                path: '/goodcomment',
                element: <Goodcomment></Goodcomment>
            },
            {
                path: '/share',
                element: <Share></Share>
            },
            {
                path: 'servergoods',
                element: <ServeGoods></ServeGoods>
            },
            {
                path: 'kefu',
                element: <Kefu></Kefu>
            },
            {
                path: 'normalgoods',
                element: <Normalgoods></Normalgoods>

            }, {

                path: '/serveclass',
                element: <Serveclass></Serveclass>
            },
            {
                path: '/onvacation',
                element: <Onvacation></Onvacation>
            },
            {
                path: '/advice',
                element: <Advice></Advice>
            },
            {
                path: '/goodclass',
                element: <Goodclass></Goodclass>
            },
            {
                path: 'orderhandle',
                element: <Orderhandle></Orderhandle>
            },
            {
                path: 'orderprocess',
                element: <OrderProcess></OrderProcess>
            },
            {
                path: 'orderhistory',
                element: <OrderHistory></OrderHistory>
            },
            {
                path: 'workleave',
                element: <WorkerLeave></WorkerLeave>
            },
            {
                path: 'workpost',
                element: <WorkerPost></WorkerPost>
            },
            {
                path: 'changeworkermsg',
                element: <ChangeWorkerMsg></ChangeWorkerMsg>
            }

        ]
    },
    {
        path: '/login',
        element: <Login></Login>
    },


]
export default routes